const express = require('express');
const router = express.Router();

router.get('/forCurrentUser', (req, res) => {
    const content = [];
    for(let i = 0; i < 40; i++) content.push({
        id: `${i + 1}`,
        brandCode: 'string',
        code: 'string',
        dealerCode: 'string',
        technologyActivityName: 'string',
        technologyActivityStatus: 1,
        content: 'string',
        endTime: '2020-05-09T03:20:59.894Z',
        status: 1,
        settlementStatus: 1,
        laborFee: 1,
        materialFee: 1,
        mgmtFee: 1,
        assistantFee: 1,
        totalFee: 1,
        rowVersion: 'string',
        options: [
            'update',
            'submit',
            'abandon',
        ]
    });
    res.json({
        message: '',
        payload: {
            content,
            totalElements: 41,
        }
    });
});
router.get('/forClaimSettlements', (req, res) => {
    const content = [];
    const {pageIndex, pageSize} = req.query;
    for(let i = 0; i < 20; i++)
        content.push({
            id: `2019${i}`,
            code: `SP-2019-${i}`,
            laborFee: 30,
            materialFee: 40,
            mgmtFee: 50,
            assistantFee: 60,
            totalFee: 70,
            details: [
                {
                    id: `string${i}`,
                    vin: 'string',
                    engineCode: 'string',
                    saleDate: '2020-05-06T09:44:08.791Z',
                    mileage: 10,
                    labourType: 20,
                    laborFee: 30,
                    materialFee: 40,
                    mgmtFee: 50,
                    assistantFee: 60,
                    totalFee: 70
                }
            ]
        });
    res.json({
        message: '',
        payload: {
            content,
            pageIndex: parseInt(pageIndex, 10),
            pageSize: parseInt(pageSize, 10),
            totalElements: 50
        }
    });
});

router.get('/:id', (req, res) => {
    res.json(
        {
            message: 'string',
            payload: {
                id: '1',
                code: 'string',
                dealerCode: 'string',
                dealerName: 'string',
                brandId: 'string',
                brandCode: 'string',
                brandName: 'string',
                technologyActivityId: 'string',
                technologyActivityCode: 'string',
                technologyActivityName: 'string',
                startTime: '2020-05-09T03:20:59.894Z',
                endTime: '2020-05-09T03:20:59.894Z',
                laborFee: 1,
                materialFee: 1,
                mgmtFee: 1,
                assistantFee: 1,
                totalFee: 1,
                remark: 'string',
                checkLabor: 1,
                checkChangeLabor: 1,
                checkChangeAssistLabor: 1,
                checkLaborFee: 1,
                checkChangeLaborFee: 1,
                checkChangeAssistLaborFee: 1,
                rowVersion: 'string',
                options: [
                    'update',
                    'submit',
                    'abandon',
                ],
                details: [
                    {
                        id: '1',
                        dealerId: 'string',
                        dealerCode: 'string',
                        dealerName: 'string',
                        technologyActivityVehicleId: 'string',
                        vin: 'string',
                        engineCode: 'string',
                        saleDate: '2020-05-09T03:20:59.894Z',
                        mileage: 1,
                        repairDate: '2020-05-09T03:20:59.894Z',
                        labourType: 1,
                        laborFee: 1,
                        materialFee: 1,
                        mgmtFee: 1,
                        assistantFee: 1,
                        totalFee: 1
                    }
                ],
            }
        }
    );
});
module.exports = router;
